//导入封装好的axios
import request from "./request"
import qs from "qs"
//定义一个请求精品的数据
export const JingPingAPI = () => request.get("/products/recommend")
//热门兑换
export const HotAPI = () => request.get("/products/hot")
//定义一个发送验证码的数据
export const SendSMSAPI = (params) => request.post("/sendSMS", qs.stringify(params))
//验证登录的手机号和验证码
export const PhoneReginAPI = (params) => request.post("/phoneRegin", qs.stringify(params))
// 微信登录（这个接口必须用qs对数据进行格式化）
export const WeixinLoginApi = (params) => request.post(`/wechatUsers/PCLogin`, qs.stringify(params));
//绑定微信
export const bindingApi = (params) => request.post(`/wechatUsers/binding`, qs.stringify(params));
//获取用户信息
export const userProfilesAPI = () => request.get("/shop/userProfiles")

//商品详情
export const googsdetailsAPI = (id) => request.get(`/products/${id}`)
//加入到购物车
export const AddToCartApi = (params) => request.post(`/shop/carts/add`, qs.stringify(params));
//全部商品 
export const goodsSearchAPI = (params) => request.get("/products", { params }) //params:params
//请求购物车 
export const CartsAPI = () => request.get(`/shop/carts`);
//删除购物车
export const DeleteAPI = (id) => request.delete(`/shop/carts?productIds${id}`)